<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
        width: 1000px;
        height: 500px;
        margin: 50px auto;
        background: url('./img/1.jpg');
        /* 溢出隐藏 */
        overflow: hidden;
        }
        .box1{
         width: 50%;
         height: 100%;
         background: url('./img/2.jpg');
         float: left;
         /* 过渡 */
         transition: all 2s;
        }
        .box2{
         width: 50%;
         height: 100%;
         background: url('./img/3.jpg');
         float: right;
         transition: all 2s;
        }
        /* 负值向左移动100% */
        .box1:hover{
         transform: translate(-100%);
        }
        /* 正值向右移动100% */
        .box2:hover{
         transform: translate(100%);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box1"></div>
        <div class="box2"></div>
    </div>
</body>
</html>